package com.dg11185.nearshop.net.response;

import org.json.JSONException;
import org.json.JSONObject;

public class GetMyPointsResponse {
	public final static String SUCCESS = "SUCCESS";
	public final static String FAILE = "FAILE";
	public final static String ILLEGAL_PAR = "ILLEGAL_PAR";
	public final static String MEM_NOTFOUND = "MEM_NOTFOUND";
	public final static String NOT_MEMCARDSERVICES = "NOT_MEMCARDSERVICES";
	public final static String EXCEPTION = "EXCEPTION";
	public final static String ILLEGAL_SIGN = "ILLEGAL_SIGN";

	public String responseStr;
	public String status;
	public String points = "";
	public String givingPoints = "";
	public String exchangePoints = "";
	public String usePoints = "";

	public void parseJson(String response) throws JSONException {
		this.responseStr = response;
		JSONObject jsonObject = new JSONObject(response);
		status = jsonObject.getString("status");
		if (!jsonObject.isNull("memPoints")) {
			JSONObject j = jsonObject.getJSONObject("memPoints");
			points = j.getString("points");
			givingPoints = j.getString("givingPoints");
			exchangePoints = j.getString("exchangePoints");
			usePoints = j.getString("usePoints");
		}

	}

}
